﻿using Microsoft.Xrm.Sdk;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EWSEditor.CRM
{
    public class SyncEntity : Microsoft.Xrm.Sdk.Entity
    {
        public string Name
        {
            get;
            set;
        }
        private SyncChangeType _changeType;
        public SyncChangeType ChangeType
        {
            get { return _changeType; }
            set { _changeType = value; }
        }

        public SyncEntity(Entity entity)
        {
            this.Attributes = entity.Attributes;
            this.EntityState = entity.EntityState;
            this.ExtensionData = entity.ExtensionData;
            this.Id = entity.Id;
            this.KeyAttributes = entity.KeyAttributes;
            this.LogicalName = entity.LogicalName;
            this.RowVersion = entity.RowVersion;
        }

    }

    public enum SyncChangeType
    {
        None,
        CreateUpdate,
        Delete
    }
}
